<% include("../public/commonheader.html"){}%><!-- 配置文件 -->
<div class="layui-fluid">
  <div class="layui-row">
    <form class="layui-form">
	  <div class="layui-form-item">
         <label for="L_oldpass" class="layui-form-label"><span class="x-red">*</span>${L.oldpass}：</label>
         <div class="layui-input-inline">
           <input type="password" id="L_oldpass" name="oldpass" lay-verify="required" autocomplete="off" class="layui-input">
         </div>
      </div>
	  <div class="layui-form-item">
         <label for="L_newpass" class="layui-form-label"><span class="x-red">*</span>${L.newpass}：</label>
         <div class="layui-input-inline">
           <input type="password" id="L_newpass" name="newpass" lay-verify="required" autocomplete="off" class="layui-input">
		  </div>
      </div>

	  <div class="layui-form-item">
         <label for="L_confirmpass" class="layui-form-label"><span class="x-red">*</span>${L.confirmpass}：</label>
         <div class="layui-input-inline">
           <input type="password" id="L_confirmpass" name="confirmpass" lay-verify="confirmpass" lay-verify="required" autocomplete="off" class="layui-input">
		  </div>
      </div>
     <div class="layui-form-item">
	   <label for="L_submit" class="layui-form-label"></label>
       <button class="layui-btn" lay-filter="edit" lay-submit="">提交修改</button>
	 </div>
</form>
</div>
</div>
<% include("../public/commonfooter.html"){}%>
<script>
layui.use(['form', 'layer','jquery'],
            function() {
                $ = layui.jquery;
                var form = layui.form,
                layer = layui.layer;

				form.verify({
                    confirmpass: function(value) {
                        if ($('#L_newpass').val() != $('#L_confirmpass').val()) {
                            return '两次密码不一致';
                        }
                    }
                });

                //监听提交
                form.on('submit(edit)',
                function(data) {
					data=data.field;
					$.post(jkas.url("/admin/passport/reset"),data,function(result)
					{
                     if(200==result.code)
					 {
                      layer.alert("修改成功", {
                        icon: 6
                      },
                      function() {
                        //关闭当前frame
                        Sca.close();

                        // 可以对父窗口进行刷新 
                        Sca.father_reload();
                      });
					  }
					  else
					  { layer.alert("操作失败："+result.msg, {
                        icon: 5
                        });
					  }
				   },"json");
                    return false;
                });

            });
</script>